this.isTransient = isTransient;
},
+ setTitle: function(newTitle) {
+ this.title = newTitle;
+ this.emit('title-changed');
+ },
+
// Called to create a new icon actor (of size this.ICON_SIZE).
// Must be overridden by the subclass if you do not pass icons
// explicitly to the Notification() constructor.
this._sourceTitleBin.child = this._sourceTitle;
this._sourceTitleBin.width = 0;
+ this.source.connect('title-changed',
+ Lang.bind(this, function() {
+ this._sourceTitle.text = source.title;
+ }));
+
this._sourceBox.add(this._sourceIcon, { y_fill: false });
this._sourceBox.add(this._sourceTitleBin, { expand: true, y_fill: false });
this.actor.child = this._sourceBox;
// with a transient one from the same sender, so we
// always create a new source object for new transient notifications
// and never add it to this._sources .
- if (!isForTransientNotification && this._sources[pid])
- return this._sources[pid];
+ if (!isForTransientNotification && this._sources[pid]) {
+ let source = this._sources[pid];
+ source.setTitle(title);
+ return source;
+ }
let source = new Source(title, pid);
source.setTransient(isForTransientNotification);
_updateAlias: function() {
let oldAlias = this.title;
- this.title = this._contact.get_alias();
+ this.setTitle(this._contact.get_alias());
this._notification.appendAliasChange(oldAlias, this.title);
this.pushNotification(this._notification);
},